/**
  ******************************************************************************
  * @file    jcff_stc_uart.c
  * @author  Edward Huang
  *          Connect to me via Wechat, "jct_10"
  * @date    2021-04-21
  * 
  * @brief   STC8 UART module driver.
  *          This file provides firmware functions to manage the following
  *          (.) Configure the STC8A UART[1..4];
  *          (.) Read the UART[1..4] data byte;
  *          (.) Send data via the UART[1..4];
  * @note    (+) The standard STC8A UART0 has mode 0 and mode 1, you have to use 
  *          the fixed boudrate if use this two mode. In addition it not compatible 
  *          with the existing common UART boudrate like 9600, 115200. So consider
  *          these useless function, our driver doesn't support this.
  *          (+) Because of the disadvantages of MCS-51, the UART must rely on timer 
  *          to generate baud rate. In the old chip, there is not any problem because
  *          the only UART can just use the timer 1. However the new 51-core device
  *          has several UARTs and timers, it's  is an embarrassing problem to group
  *          them. For dealing with this, out drivers specified timer for each UART.
  *          So before using the timers, you should make sure if the timer is used
  *          by the UART.
  *          UART     |     TIMER
  *        ----------------------------
  *          UART1    |     TIMER1
  *        ----------------------------
  *          UART2    |     TIMER2
  *        ----------------------------
  *          UART3    |     TIMER3
  *        ----------------------------
  *          UART4    |     TIMER4
  * @attention
  * This software component is licensed by Joy creator (JCTech) under GPL license,
  * the "License"; You may not use this file except in compliance with the
  * License. You may obtain a copy of the License at:
  *                              jcff_stc_lib\LICENSE
  *
  ******************************************************************************
  ==============================================================================
  */
 
#include "jcff_stc_uart.h"
